1. Field of the Invention
The present invention relates to an image forming apparatus that shifts to a different power state, a method of controlling the same, and a storage medium.
2. Description of the Related Art
Recent image forming apparatuses tend to be increased in time required for activation. A factor as one of the causes for this is that the size of data to be loaded from a ROM into a RAM during activation of each apparatus has been increased due to increased functionality of the apparatus.
To solve this problem, there has been proposed a technique for holding data stored in the RAM when the user turns off the power switch, and reducing time required for activation by omitting processing for loading the data from the ROM into the RAM when the user turns on the power switch next time.
Further, there has been proposed a technique called “suspend” for holding data stored in the RAM by continuing the supply of power to the RAM (see e.g. Japanese Patent Laid-Open Publication No. H09-34578).
Also, there has been proposed a technique called “hibernation” for holding data stored in the RAM by temporarily saving the data stored in the RAM in a HDD (see e.g. Japanese Patent Laid-Open Publication No. 2000-82014). In this technique, even though it appears to a user that the apparatus is completely powered off, it is possible to reduce the time required for activation.
Recent image forming apparatuses carry out power supply control responsive to a user's operation on the power switch using software. Conventional image forming apparatuses are configured such that the supply and cutoff of power are electrically switched according to the operation of the power switch, such as a rocker switch, and hence it has not been required to carry out the power supply control by software processing.
In recent years, there is a demand for enabling the powering on or off of an image forming apparatus via a network, and to meet this demand, an increasing number of image forming apparatuses employ a tactile switch.
In an image forming apparatus provided with a tactile switch, the power is switched on or off using software such that when the tactile switch is depressed in a power-off state, a signal is generated and input to a power control circuit to turn on the power, whereas when the switch is depressed in a power-on state, a signal is similarly generated and input to the power control circuit to turn off the power.
Further, the image forming apparatuses that perform power supply control responsive to a power switch operation using software have a timer-power-off function for electrically shutting down the power supply to a controller when a predetermined time elapses after a power-off operation has been detected, as a safety measure for software runaway.
This function guarantees prevention of a situation where the power cannot be switched off, even when software runaway occurs.
In a case where the image forming apparatus is configured to continue the supply of power to the RAM of the controller against the power-off operation so as to reduce the time required to execute power-on startup of the image forming apparatus, it is necessary to make the image forming apparatus appear to the user as if it were in the power-off state even though power is being supplied to the RAM.
To this end, the image forming apparatus is placed in a quick activation standby state in which the supply of power to at least a printer engine is interrupted and power used by units within the controller other than the RAM is saved as much as possible. That is, if the power switch is depressed during a standby state, the image forming apparatus shifts to the quick activation standby state, and if the power switch is depressed during the quick activation standby state, the image forming apparatus shifts to the standby state.
During the quick activation standby state, a CPU that controls on/off of the power is in an energized state, and hence there is a possibility that if the CPU runs away due to some reason, power control firmware does not normally operate, preventing the image forming apparatus from returning to the standby state even when the power switch is depressed.
In this case as well, the above-described timer-power-off function makes it possible to forcibly and electrically shut down the power supply to the controller.
However, in a case where the power switch is depressed during the quick activation standby state, the user intends to activate the image forming apparatus. In this case, if the above-described timer-power-off function is operated, even though the user intends to activate the image forming apparatus, the power supply to the controller is electrically shut down, causing the image forming apparatus to shift to the power-off state.
In such a case, the user is required, after confirming that the image forming apparatus has shifted to the power-off state, to depress the power switch again to thereby start up the image forming apparatus, which is undesirable to the user.
Further, time taken to shift the power supply state is sometimes different depending on a shifting process. For example, a shifting time period required to shift the power supply state from the standby state to the quick activation standby state and a shifting time period required to shift the same from the quick activation standby state to the standby state are often different from each other.
For this reason, if a monitoring time period to elapse before the timer function is operated is uniformly set, in a case where there are a plurality of power state-shifting processes which are different in shifting time period, it is impossible to set a proper monitoring time period according to each power state.
For example, assuming that the monitoring time period is reduced in a manner adjusted to a power state-shifting process which requires a short shifting time period, when a power state-shifting process which requires a long shifting time period is executed, the timer function is executed even though the power state-shifting process is being normally executed.
On the other hand, assuming that the monitoring time period is increased in a manner adjusted to a power state-shifting process which requires a long shifting time period, when a power state-shifting process which requires a short shifting time period is executed, in case this power state-shifting process is stopped in the middle of execution thereof, it takes a longer time than necessary before the timer function is executed.